﻿namespace WebAPI.Dao;

public class ResultData
{
    public static string Ok(object data)
    {
        Dictionary<string, object> map = new Dictionary<string, object>();
        map.Add("status", 200);
        map.Add("data", data);
        return JsonConvert.ToJsonString(map);
    }
    
    public static string NotPermission(object data)
    {
        Dictionary<string, object> map = new Dictionary<string, object>();
        map.Add("status", 403);
        map.Add("data", data);
        return JsonConvert.ToJsonString(map);
    }
    
    
    public static string NotFound(object data)
    {
        Dictionary<string, object> map = new Dictionary<string, object>();
        map.Add("status", 404);
        map.Add("data", data);
        return JsonConvert.ToJsonString(map);
    }
    
    public static string UsernameOrPasswordWrong(object data)
    {
        Dictionary<string, object> map = new Dictionary<string, object>();
        map.Add("status", 401);
        map.Add("data", data);
        return JsonConvert.ToJsonString(map);
    }
}